#include <bits/stdc++.h>
using namespace std;

const int inf = (int)1e9 + 1;

struct node {
	int value;
	char color;

	node *left, *right;
	node *parent;
	node() : value(inf + 1), color(0), left(NULL), right(NULL), parent(NULL) {}
};

typedef node* tree;

void right_turn(tree &t, tree &father, tree &root, tree &uncle) {
    if (root->parent != NULL) {
        if (root->parent->left == root) {
            root->parent->left = father;
        } else {
            root->parent->right = father;
        }
    } else {
        T = father;
    }
    tree gamma = father->right;
    father->parent = root->parent;
    father->right = root;
    father->color = 0;
    root->parent = father;
    root->left = gamma;
    if (gamma)
        gamma->parent = root;
    root->color = 1;
    return;	
}

void right_in_turn(tree &t, tree &father, tree &root, tree &uncle) {
    if (root->parent) {
        if (root->parent->left == root) {
            root->parent->left = t;
        } else {
            root->parent->right = t;
        }
    } else {
        T = t;
    }
    tree alpha = t->left, beta = t->right;
    t->parent = root->parent;
    t->color = 0;
    t->left = father;
    t->right = root;
    father->right = alpha;
    if (alpha)
        alpha->parent = father;
    father->parent = t;
    root->parent = t;
    root->left = beta;
    if (beta)
        beta->parent = root;
    root->color = 1;
    return;	
}

void left_turn(tree &t, tree &father, tree &root, tree &uncle) {
   if (root->parent != NULL) {
        if (root->parent->left == root) {
            root->parent->left = father;
        } else {
            root->parent->right = father;
        }
    } else {
        T = father;
    }
    tree gamma = father->left;
    father->parent = root->parent;
    father->left = root;
    father->right = t;
    father->color = 0;
    root->right = gamma;
    root->parent = father;
    if (gamma)
        gamma->parent = root;
    root->color = 1;
    return;	
}

void left_in_turn(tree &t, tree &father, tree &root, tree &uncle) {
    if (root->parent != NULL) {
        if (root->parent->left == root) {
            root->parent->left = t;
        } else {
            root->parent->right = t;
        }
    } else {
        T = t;
    }
    tree delta = t->left, eps = t->right;
    t->parent = root->parent;
    t->left = root;
    t->right = father;
    t->color = 0;
    root->right = delta;
    if (delta)
        delta->parent = root;
    root->color = 1;
    root->parent = t;
    father->left = eps;
    if (eps)
        eps->parent = father;
    father->parent = t;
    return;	
}

void balance(tree &t) {
	while (t->parent != NULL) {
        if (!t->parent->color) {
            return;
        }
        if (t->parent->parent == NULL) {
            t->parent->color = 0;
            return;
        }
        tree root = t->parent->parent;
        bool left = (root->left == t->parent);
        tree uncle = (left ? root->right : root->left);
        tree father = t->parent;
        if (uncle && uncle->color) {
            uncle->color = 0;
            root->color = 1;
            t->parent->color = 0;
            t = t->parent->parent;
            continue;
        }
        bool left2 = (father->left == t);
        if (left && left2) {
        	first_turn(t, father, root, uncle);
        }
        if (left && !left2) {
        	second_turn(t, father, root, uncle);
        }
        if (!left && !left2) {
        	third_turn(t, father, root, uncle);
        }
        if (!left && left2) {
        	fourth_turn(t, father, root, uncle);
        }
    }
}

void insert(int value, tree &T) {
	tree t = T, pr = NULL;
	while (t != NULL) {
		if (t->value == value) {
			return;
		} else if (t->value < value) {
			pr = t, t = t->right;
		} else {
			pr = t, t = t->left;
		}
	}
	t = new node();
	t->value = value;
	t->color = 1;
	t->parent = pr;
	if (pr) {
        if (pr->value < value) {
            pr->right = t;
        } else {
            pr->left = t;
        }
	}
	balance(t);
	t->color = 0;
    T = t;
}

bool check(int value, tree t) {
	while (t) {
		if (t->value == value) {
			return 1;
		}
		if (t->value < value) {
			t = t->right;
		} else {
			t = t->left;
		}
	}
	return 0;
}

int check_tree(tree t) {
    if (t == NULL) {
        return 0;
    }
    int len = 1 - t->color;
    int x = check_tree(t->left), y = check_tree(t->right);
    if (x == -1 || x != y) {
        return -1;
    }
    return x + len;
}

int main() {
    freopen("input.txt", "r", stdin);
    int n;
	scanf("%d", &n);
	tree T = NULL;
	while (n-- > 0) {
		int t, v;
		scanf("%d%d", &t, &v);
		if (t == 0) {
			insert(v, T);
		} else {
			puts(check(v, T) ? "Yes" : "No");
		}
	}
}
